package com.syq.face.service;


import com.syq.face.model.AttendanceInfo;
import com.syq.face.model.BaseResponseBody;
import com.syq.face.model.JsonResult;
import com.syq.face.model.LoginInfo;
import com.syq.face.model.ManagementGroupInfo;
import com.syq.face.model.UserInfo;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface UserService {

//    @POST("/user/login")
//    @FormUrlEncoded
//    Call<User> login(@Field("username") String username, @Field("passwd") String passwd);

    //Post的表单登录
    @FormUrlEncoded
    @POST("/fras/login")
    Call<JsonResult<LoginInfo>> login(@Field("username") String username, @Field("password") String password);

    @GET("/fras/user/userGroups")
    Call<JsonResult<List<ManagementGroupInfo>>> getGroups(@Header("Authorization") String token);

    @GET("/fras/user/user")
    Call<JsonResult<UserInfo>> getUser(@Header("Authorization") String token);

    @POST("/fras/logout")
    Call<JsonResult> loginOut(@Header("Authorization") String token);


    @GET
    Call<JsonResult<List<AttendanceInfo>>> getAttendances(@Url String url,
                                                          @Header("Authorization") String token
    );


//    @GET("http://192.168.43.234:8033/file/user/getEnableAttendancesByGroup/{groupId}")
//    Call<List<String>> getAttendances(@Path("groupId") String groupId);
}
